package com.zhongke.DKYCboot.util;

public class Result {

	private int code;

	private String msg;

	private Object data;

	private Result(int code, String msg, Object data) {
		this.code = code;
		this.data = data;
		this.msg = msg;
	}

	public static Result ok() {
		return new Result(1, "操作成功", null);
	}
	
	public static Result ok(Object data) {
		return new Result(1, "操作成功", data);
	}
	
	public static Result error(String msg) {
		return new Result(0, msg, null);
	}

	public static Result error() {
		return new Result(0, "操作失败", null);
	}
	
	public int getCode() {
		return code;
	}

	public void setCode(int code) {
		this.code = code;
	}

	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public Object getData() {
		return data;
	}

	public void setData(Object data) {
		this.data = data;
	}

}
